#include "Vector2D.h"

qreal Vector2D::length() const
{
	qreal len = 
		m_x * m_x +
		m_y * m_y;
	return qreal(std::sqrt(len));
}

qreal Vector2D::lengthSquared() const
{
	return 
		m_x * m_x +
		m_y * m_y;
}

qreal Vector2D::distanceToPoint(const Vector2D &point) const
{
	return (*this - point).length();
}